package com.learnosity.extendotext.style
{
	import com.learnosity.extendotext.Rule;
	import flash.text.engine.ElementFormat;
	import flash.text.engine.FontDescription;
	import flash.text.engine.FontWeight;
		
	public class FontWeight
	{

		static public function apply(rule:Rule,format:ElementFormat):ElementFormat{
			//Get an unlocked font description
			var fd:FontDescription = format.fontDescription.clone();
			if(rule.value == 'bold')
				fd.fontWeight = flash.text.engine.FontWeight.BOLD;
			else
				fd.fontWeight = flash.text.engine.FontWeight.NORMAL;
			format.fontDescription = fd;
			return format;
		}

	}
}